package com.nq.controller.backend;


import com.nq.common.ServerResponse;
import com.nq.pojo.DomainConfig;
import com.nq.pojo.SiteAdmin;
import com.nq.service.IDomainConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping({"/admin/domainConfig"})
public class AdminDomainConfigController {

    @Autowired
    private IDomainConfigService domainConfigService;


    /**
     * 新增域名
     * @param domainConfig
     * @return
     */
    @RequestMapping({"add.do"})
    @ResponseBody
    public ServerResponse add(DomainConfig domainConfig) {
        return this.domainConfigService.add(domainConfig);
    }


    /**
     * 修改域名
     * @param domainConfig
     * @return
     */
    @RequestMapping({"update.do"})
    @ResponseBody
    public ServerResponse update(DomainConfig domainConfig) {
        return this.domainConfigService.update(domainConfig);
    }


    /**
     * 删除域名
     * @param id
     * @return
     */
    @RequestMapping({"delete.do"})
    @ResponseBody
    public ServerResponse delete(Integer id) {
        return this.domainConfigService.delete(id);
    }


    /**
     * 获取域名列表
     * @return
     */
    @RequestMapping({"listDomain.do"})
    @ResponseBody
    public ServerResponse listDomain() {
        return this.domainConfigService.listDomain();
    }

}
